#define _CRT_SECURE_NO_WARNINGS 1

#include"Sort.h"
#include"Stack.h"

void TestInsertSort()
{
	int a[] = { 9,8,7,6,5,4,3,3,2,1 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
    InsertSort(a,sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

void TestShellSort()
{
	int a[] = { 9,8,7,6,5,4,3,3,2,1 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

void TestSelectSort()
{
	int a[] = { 9,8,7,6,5,4,3,3,2,1 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	SelectSort(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}


void TestBubbleSort()
{
	int a[] = { 1,7,6,8,5,4,3,3,2,9 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	BubbleSort(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

void TestQuickSort()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8};
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	/*QuickSort(a, 0, sizeof(a) / sizeof(a[0]) - 1);*/
	QuickSortNonR(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

void TestMergeSort()
{
	int a[] = { 10,6,7,1,3,9,6,2 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	MergeSort(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

void TestMergeSortNonR()
{
	int a[] = { 10,6,7,1,3,9,6,2,5 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	MergeSortNonR(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}


void TestCountSort()
{
	int a[] = { 10,6,7,1,3,9,6,2,5 };
	PrintSort(a, sizeof(a) / sizeof(a[0]));
	CountSort(a, sizeof(a) / sizeof(a[0]));
	PrintSort(a, sizeof(a) / sizeof(a[0]));
}

int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestBubbleSort();
    /*TestQuickSort();*/
	//TestMergeSort();
	/*TestMergeSortNonR();*/
	TestCountSort();
	return 0;
}